package com.pdstudio.weather;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.TextView;

public class CustomTitleActivity extends Activity {

	private ImageView imgHome;// 首页图标
	private ImageView imgProducts;// 所有产品
	private ImageView imgSettings;// 系统设置
	private TextView txtTitle;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_custom_title);

		txtTitle = (TextView) findViewById(R.id.title_text_nav);
		txtTitle.setText("测试测试");

		imgHome = (ImageView) findViewById(R.id.title_img_main);
		imgHome.setImageDrawable(getResources().getDrawable(
				R.drawable.nav_settings));

		imgHome.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO 在这里加入点击首页按钮图标的事件，暂时不知道是否需要 by @wangshu

			}

		});

	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.custom_title, menu);
		return true;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		// Handle action bar item clicks here. The action bar will
		// automatically handle clicks on the Home/Up button, so long
		// as you specify a parent activity in AndroidManifest.xml.
		int id = item.getItemId();
		if (id == R.id.action_settings) {
			return true;
		}
		return super.onOptionsItemSelected(item);
	}
}
